#include "dwt_client.h"
#include "arq.h"

#if ARQ_x86

#else
#include <dsplib.h>
#endif

#include <stdlib.h>


double fLowAnalysis[FILTER_LEN];
double fHiAnalysis[FILTER_LEN];
double fLowSynthesis[FILTER_LEN];
double fHiSynthesis[FILTER_LEN];

void DWT_INIT() {
    daubechies_analysis_initialize(fLowAnalysis, fHiAnalysis);
    daubechies_synthesis_initialize(fLowSynthesis, fHiSynthesis);
}

int DWT(double values[MOSTRES], double approx[SPEC_SIZE], double detail[SPEC_SIZE]) {
    /* PREPARING FOR CONVERT */
    dwt_neo(values, MOSTRES, fLowAnalysis, fHiAnalysis,
            FILTER_LEN, approx, detail, SPEC_SIZE, METHOD);
    return 0;
}

int iDWT(double approx[SPEC_SIZE], double detail[SPEC_SIZE], double values[MOSTRES]) {
    /* PEPARING FOR GO BACK */
    idwt_neo(approx, detail, SPEC_SIZE,
            fLowSynthesis, fHiSynthesis, FILTER_LEN, values, MOSTRES);
    return 0;
}
